package com.daffodil.workable.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

import com.daffodil.core.annotation.Hql;
import com.daffodil.core.annotation.Hql.Logical;
import com.daffodil.core.entity.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * -连线信息对象
 * @author yweijian
 * @date 2022-04-07
 * @version 1.0
 * @description
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Entity
@Table(name = "wok_line")
public class WorkableLine extends BaseEntity<String> {

    private static final long serialVersionUID = 8019335312629337526L;

    /** 主键编号 */
    @Id
    @GeneratedValue(generator = "uuid")
    @GenericGenerator(name = "uuid", strategy = "uuid")
    @Column(name = "id")
    private String id;

    /** 任务编号 */
    @Column(name = "task_id")
    @Hql(type = Logical.EQ)
    private String taskId;

    /** 源始编号 */
    @Column(name = "source_id")
    @Hql(type = Logical.EQ)
    private String sourceId;

    /** 目标编号 */
    @Column(name = "target_id")
    @Hql(type = Logical.EQ)
    private String targetId;

    /** 连线名称 */
    @Column(name = "label")
    @Hql(type = Logical.LIKE)
    private String label;
    
    /** 连线条件表达式 */
    @Column(name = "expression")
    private String expression;
    
    /** 创建者 */
    @Column(name = "create_by")
    @Hql(type = Logical.EQ)
    private String createBy;

    /** 创建时间 */
    @Column(name = "create_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 更新者 */
    @Column(name = "update_by")
    @Hql(type = Logical.EQ)
    private String updateBy;

    /** 更新时间 */
    @Column(name = "update_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

}
